package com.swanclouds.model.managers;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.model.ModelEntity;

/**
 * @author 李文强
 * description
 */

public class Configuration implements ModelEntity {

    //导入配置文件路径
    //远程导入：“文件传输协议://用户名:密码@ip地址/目录/文件名”
    //文件传输协议包括：https、nfs、cifs
    @JsonProperty("Content")
    private String content;

    @JsonProperty("Type")
    //导入配置文件类型：包括：bios raid
    private String type;

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "Configuration{" +
                "content='" + content + '\'' +
                ", type='" + type + '\'' +
                '}';
    }
}
